package com.ruoyi.jypc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jypc.mapper.CanteenorderMapper;
import com.ruoyi.jypc.domain.Canteenorder;
import com.ruoyi.jypc.service.ICanteenorderService;

/**
 * 用餐订单Service业务层处理
 * 
 * @author wwq
 * @date 2022-10-27
 */
@Service
public class CanteenorderServiceImpl implements ICanteenorderService 
{
    @Autowired
    private CanteenorderMapper canteenorderMapper;

    /**
     * 查询用餐订单
     * 
     * @param orderid 用餐订单主键
     * @return 用餐订单
     */
    @Override
    public Canteenorder selectCanteenorderByOrderid(Long orderid)
    {
        return canteenorderMapper.selectCanteenorderByOrderid(orderid);
    }

    /**
     * 查询用餐订单列表
     * 
     * @param canteenorder 用餐订单
     * @return 用餐订单
     */
    @Override
    public List<Canteenorder> selectCanteenorderList(Canteenorder canteenorder)
    {
        return canteenorderMapper.selectCanteenorderList(canteenorder);
    }

    /**
     * 新增用餐订单
     * 
     * @param canteenorder 用餐订单
     * @return 结果
     */
    @Override
    public int insertCanteenorder(Canteenorder canteenorder)
    {
        canteenorder.setCreateTime(DateUtils.getNowDate());
        return canteenorderMapper.insertCanteenorder(canteenorder);
    }

    /**
     * 修改用餐订单
     * 
     * @param canteenorder 用餐订单
     * @return 结果
     */
    @Override
    public int updateCanteenorder(Canteenorder canteenorder)
    {
        canteenorder.setUpdateTime(DateUtils.getNowDate());
        return canteenorderMapper.updateCanteenorder(canteenorder);
    }

    /**
     * 批量删除用餐订单
     * 
     * @param orderids 需要删除的用餐订单主键
     * @return 结果
     */
    @Override
    public int deleteCanteenorderByOrderids(Long[] orderids)
    {
        return canteenorderMapper.deleteCanteenorderByOrderids(orderids);
    }

    /**
     * 删除用餐订单信息
     * 
     * @param orderid 用餐订单主键
     * @return 结果
     */
    @Override
    public int deleteCanteenorderByOrderid(Long orderid)
    {
        return canteenorderMapper.deleteCanteenorderByOrderid(orderid);
    }
}
